{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "332126f9-3524-4223-bcc6-24b9818b77b5",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "from mythic import mythic"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "abfa531f-5e7a-400b-910c-92a62106ccbe",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "mythic_instance = await mythic.login(\n",
    "        username=\"mythic_admin\",\n",
    "        password=\"mythic_password\",\n",
    "        server_ip=\"mythic_nginx\",\n",
    "        server_port=7443,\n",
    "        timeout=-1\n",
    "    )\n",
    "print(mythic_instance)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "fa3c9e18-12b3-4b88-9157-c1b920fc64c7",
   "metadata": {
    "tags": []
   },
   "outputs": [],
   "source": [
    "my_info = await mythic.execute_custom_query(\n",
    "    mythic=mythic_instance,\n",
    "    query=\"\"\"\n",
    "    query myInfo($username: String!){\n",
    "        operator(where: {username: {_eq: $username}}) {\n",
    "            id\n",
    "            username\n",
    "            current_operation_id\n",
    "            operatoroperations {\n",
    "                view_mode\n",
    "                operation {\n",
    "                    name\n",
    "                    id\n",
    "                }\n",
    "            }\n",
    "        }\n",
    "    }\n",
    "\"\"\",\n",
    "    variables={\"username\": mythic_instance.username},\n",
    ")\n",
    "print(my_info)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "77b89409-31c8-44d8-877f-bec19f261e01",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
